{extend name="admin@public/main"}

{block name="button"}
<xblock>
    {if auth("$classuri/clear")}
    <button class="layui-btn layui-btn-xs" data-post='{:url("$classuri/clear")}'><i class="layui-icon"></i>刷新权限节点</button>
    {/if}
    <span class="x-right" style="line-height:40px"></span>
</xblock>
{/block}

{block name="table"}
<table lay-size="sm" class="layui-table">
    <thead>
    <tr>
        <th width="50">权限规则</th>
        <th width="100">权限名称</th>
        <th width="100">权限</th>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="vo"}
    <tr>
        <td>
            {switch name="vo.level"}
            {case value="2"}｜—{/case}
            {case value="3"}｜&#12288;｜—{/case}
            {/switch}
            {$vo.path}
        </td>
        <td>
            {switch name="vo.level"}
            {case value="2"}｜—{/case}
            {case value="3"}｜&#12288;｜—{/case}
            {/switch}
            {$vo.title|default=""}
        </td>
        <td>
            {if isset($vo.auth)}
            {switch name="vo.auth"}
            {case value="0"}<span style="color: #FFB800">无验证</span>{/case}
            {case value="1"}<span style="color: #1E9FFF">需登录</span>{/case}
            {case value="2"}<span style="color: #5FB878">需授权</span>{/case}
            {default /}<span style="color: red">错误的权限值："{$vo.auth}"</span>
            {/switch}
            {/if}
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
{/block}